package com.flying.invest.discovery.service;

import java.util.Date;

import com.flying.common.annotation.DaoCreate;
import com.flying.common.annotation.DaoQuery;
import com.flying.common.annotation.DaoRemove;
import com.flying.common.annotation.DaoUpdate;
import com.flying.common.util.Codes;
import com.flying.framework.annotation.MethodInfo;
import com.flying.framework.annotation.Param;
import com.flying.framework.annotation.Service;
import com.flying.framework.service.AbstractService;
import com.flying.framework.model.ActionResult;
import com.flying.framework.model.QueryResult;

import com.flying.invest.discovery.model.Discovery;

@Service(value="DiscoveryService", desc="发现")
public class DiscoveryService extends AbstractService{
        
	@MethodInfo("新增")
	@DaoCreate(entity=Discovery.ENTITY_NAME)
	public Discovery create(
			@Param(value=Discovery.INHERITED_ID, required=false,	desc="继承发现ID") Long inherited_id,
			@Param(value=Discovery.USER_ID, required=true,	desc="所属用户") Long user_id,
			@Param(value=Discovery.TYPE_ID, required=true,	desc="类型ID") Long type_id,
			@Param(value=Discovery.NAME, required=true,	desc="名称") String name,
			@Param(value=Discovery.REMARKS, required=false,	desc="说明") String remarks,
			@Param(value=Discovery.ASSETS_TYPE_ID, required=true,	desc="投资品种类型") Long assets_type_id,
			@Param(value=Discovery.STATUS, required=false,	desc="状态（0：无效；1：有效）") Integer status,
			@Param(value=Discovery.LAST_EXECUTE, required=false,	desc="最近执行时间") Date last_execute,
			@Param(value=Discovery.CREATOR, required=false,	desc="创建人") String creator,
			@Param(value=Discovery.CREATE_TIME, required=false,	desc="创建时间") Date create_time
		) {
		return null;
	}

	@MethodInfo("修改")
	@DaoUpdate(entity=Discovery.ENTITY_NAME)
	public ActionResult update(
			@Param(value=Discovery.DISCOVERY_ID, required=true,	desc="发现ID") Long discovery_id,
			@Param(value=Discovery.INHERITED_ID, required=false,	desc="继承发现ID") Long inherited_id,
			@Param(value=Discovery.USER_ID, required=true,	desc="所属用户") Long user_id,
			@Param(value=Discovery.TYPE_ID, required=true,	desc="类型ID") Long type_id,
			@Param(value=Discovery.NAME, required=true,	desc="名称") String name,
			@Param(value=Discovery.REMARKS, required=false,	desc="说明") String remarks,
			@Param(value=Discovery.ASSETS_TYPE_ID, required=true,	desc="投资品种类型") Long assets_type_id,
			@Param(value=Discovery.STATUS, required=false,	desc="状态（0：无效；1：有效）") Integer status,
			@Param(value=Discovery.LAST_EXECUTE, required=false,	desc="最近执行时间") Date last_execute,
			@Param(value=Discovery.UPDATOR, required=false,	desc="修改人") String updator,
			@Param(value=Discovery.UPDATE_TIME, required=false,	desc="修改时间") Date update_time
		) {
		return null;
	}

	@MethodInfo("删除")
	@DaoRemove(entity=Discovery.ENTITY_NAME)
	public ActionResult remove(
			@Param(value=Discovery.DISCOVERY_ID, required=true,	desc="发现ID") Long discovery_id
		) {
		return null;
	}

	@MethodInfo("搜索")
	@DaoQuery(entity=Discovery.ENTITY_NAME, pageable=true, modelClass=Discovery.class)
	public QueryResult<Discovery> findAll(
			@Param(value=Codes.PAGE_NUM, 	required=false, desc="分页页号，默认0") int page,
			@Param(value=Codes.PAGE_SIZE, 	required=false, desc="分页大小，默认10") int rows) {
		return null;
	}

	@MethodInfo("查询")
	@DaoQuery(entity=Discovery.ENTITY_NAME, single=true, throwsNotFoundException=true )
	public Discovery findById(
			@Param(value=Discovery.DISCOVERY_ID, required=true,	desc="发现ID") Long discovery_id
		) {
		return null;
	}

}